﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/TeacherMasterPage.master"  ValidateRequest="false" AutoEventWireup="true"  CodeFile="editquestion.aspx.cs" Inherits="Manage_editquestion" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript" src="../js/jquery/jquery-1.4.4.min.js"></script>
<script src="../ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="../ckfinder/ckfinder.js" type="text/javascript"></script>
<script>
    function showXuanxiang(obj) {
        var s = obj.value;
        if (s == "1" || s == "2" || s == "3") {
            $("#divSelc").show()
        } else {
            $("#divSelc").hide()
        }
    }
    function chkData() {
        var QType = $("#<%=QType.ClientID %>").val();
        if (QType == "0") {
            alert("<%= Resources.labels.PleaseChkQType%>"); return false;
        }
        var QDifficulty = $("#<%=QDifficulty.ClientID %>").val();
        if (QDifficulty == "0") {
            alert("<%= Resources.labels.PleaseChkDiff%>"); return false;
        }
        var QKnowledge = $("#<%=QKnowledge.ClientID %>").val();
        if (QKnowledge == "0") {
            alert("<%= Resources.labels.PleaseChkKnowledge%>"); return false;
        }
        if (QType == "1" || QType == "2" || QType == "3") {

            var QOptions = $("#<%=QOptions.ClientID %>").val();
            if (QOptions == "") {
                alert("<%= Resources.labels.PleaseInputOpts%>"); return false;
            }
        }
        var QAnswer = $("#<%=QAnswer.ClientID %>").val();
        if (QAnswer == "") {
            alert("<%= Resources.labels.PleaseAnswer%>"); return false;
        }

        //return false;
    }
</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<table class="grid" border="0" cellspacing="0" cellpadding="0" width="100%">
    <thead>
        <tr>
            <th>
                <div style="float:left; width:80%;">
                    <%--<%= Resources.labels.Edit%>--%>
                    <asp:Label ID="cname" runat="server" Text=""></asp:Label>
                    <%= Resources.labels.select%>:
                    <asp:DropDownList ID="QType" runat="server" ></asp:DropDownList>
                    <asp:DropDownList ID="QDifficulty" runat="server"></asp:DropDownList>
                    <asp:DropDownList ID="QKnowledge" runat="server"></asp:DropDownList>
                </div>
                <div style="text-align:right;margin-right:20px;"><a href="Course.aspx?id=<%=cid %>"><%= Resources.labels.back%></a></div>
            </th>
        </tr>
    </thead>
</table>

<asp:Label ID="cknow" runat="server" Visible=false Text=""></asp:Label>


<table id="dg" class="grid" cellspacing="0" cellpadding="0" width="100%">
    <tbody>
        <tr>
            <td>
                <%= Resources.labels.questiontitle%> <br />
                <asp:TextBox ID="Qcontent" runat="server" Height="140px" TextMode="MultiLine"  Width="100%"></asp:TextBox>
                    <script type="text/javascript">
                        if (typeof CKEDITOR == 'undefined') { document.write('加载CKEditor失败'); }
                        else {
                            var editor = CKEDITOR.replace('<%=Qcontent.ClientID %>');
                            CKFinder.SetupCKEditor(editor, '../ckfinder/');
                        }
                    </script>
            </td>
        </tr>
        <tr>
            <td>
                <div id="divSelc" style="display:<%=divisshowopt%>;"><%= Resources.labels.PleaseInputOpts%>：<asp:TextBox ID="QOptions" runat="server" Height="140px" TextMode="MultiLine" 
                    Width="100%"></asp:TextBox></div>
            </td>
        </tr>

        <tr>
            <td><%= Resources.labels.rightAnswer%>:<asp:TextBox ID="QAnswer" runat="server" Height="60px" TextMode="MultiLine" 
                    Width="100%"></asp:TextBox></td>
        </tr>
    </tbody>
        
    <tfoot>
    	<tr>
    	    <td>
                <asp:Button ID="Button1" runat="server" CssClass="button" Text="确定" onClientClick="return chkData()" onclick="Button1_Click" />
                <asp:Button ID="Button2" runat="server" CssClass="button" Text="返回" 
                    onclick="Button2_Click"  />
                </td>
    	</tr>
    </tfoot>
</table>


</asp:Content>